home *** CD-ROM | disk | FTP | other *** search
/ Champak 120 / Vol 120.iso / games / space_bo.swf / scripts / DefineSprite_194 / frame_5 / DoAction.as
Encoding:
Text File  |  2010-11-09  |  561 b   |  22 lines

  1. if(this._x > -100)
  2. {
  3.    this._x += _parent.speed - 5;
  4.    panPos = int((this._x - 275) / 2.75);
  5.    volPos = 100 - Math.abs(panPos / 3);
  6.    sfxRun.setPan(panPos);
  7.    sfxRun.setVolume(volPos);
  8.    if(this._x > 115 and this._x < 145 and _parent.rik._y > 280 and _parent.timeLeft > 0 and carryRicicle == 1)
  9.    {
  10.       carryRicicle = 0;
  11.       anim.ricicle._y = 200;
  12.       _parent.rik.anim.ricicle.gotoAndPlay(2);
  13.       _parent.riciclesCollected = _parent.riciclesCollected + 1;
  14.    }
  15.    prevFrame();
  16. }
  17. else
  18. {
  19.    sfxRun.stop();
  20.    gotoAndPlay(1);
  21. }
  22.